Ext.define('App.reportconfiguration.chartconfiguration.model.AxisModel', {
    extend: 'Extend.data.BaseModel',
    fields: [
        {name: 'type'},
        {name: 'position'},
        {name: 'fields'},
        {name: 'title'},
        {name: 'percent'},
        {
            name: 'fieldsArray',
            calculate: function (data) {
                var fields = data.fields;
                if (Ext.isEmpty(fields)) {
                    return [];
                }
                if (Ext.isArray(fields)) {
                    return fields;
                }
                return fields.split(', ');
            }
        }
    ],
    validators: {
        type: 'presence',
        position: 'presence',
        fields: 'presence',
        title: 'presence',
        fieldAliases: 'presence'
    }
});